import Vue from 'vue'
import Router from 'vue-router'
import OutLine from '@/components/outline'
import Food from '@/components/food'
import FoodInformation from '@/components/foodInformation'
import Scenery from '@/components/scenery'
import SceneryInfo from '@/components/sceneryInfomation'
import Customs from '@/components/customs'
import CustomsInfomation from '@/components/customsInfomation'
import Celebrity from '@/components/celebrity'
import CelebrityInfomation from '@/components/celebrityInfomation'
import ScenicSpots from '@/components/scenicSpots'
import Information from '@/components/information'
import Road from '@/components/road'
import History from '@/components/history'
import Panorama from '@/components/panorama'
import Photo from '@/components/photo'
import Video from '@/components/video'
import Vioce from '@/components/vioce'
import VoicePlay from '@/components/voicePlay'
import PhotoInfo from '@/components/photoInfo'
import VideoPlay from '@/components/videoPlay'
import Outline from '@/components/outline'
import Index from '@/components/index'
import TrafficInformation from '@/components/trafficInformation'
Vue.use(Router)
export default new Router({
  mode:'history',
  base: '/en',
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index
    },
    {
      path: '/food',
      name: 'food',
      component: Food
    },
    {
      path: '/foodInformation',
      name: 'foodInformation',
      meta: {
        keepAlive : true 
      },
      component: FoodInformation
    },  
    {
      path: '/scenery',
      name: 'scenery',
      component: Scenery
    },
    {
      path: '/sceneryInfo',
      name: 'sceneryInfo',
      component: SceneryInfo
    },
    {
      path: '/customs',
      name: 'customs',
      component: Customs
    },
    {
      path: '/customsInfomation',
      name: 'customsInfomation',
      component:CustomsInfomation 
    },
    {
      path: '/celebrity',
      name: 'celebrity',
      component: Celebrity
    },
    {
      path: '/celebrityInfomation',
      name: 'celebrityInfomation',
      component:CelebrityInfomation 
    },
    {
      path: '/scenicSpots',
      name: 'scenicSpots',
      component:ScenicSpots 
    },
    {
      path: '/information',
      name: 'information',
      component:Information 
    },
    {
      path: '/road',
      name: 'road',
      component:Road 
    },
    {
      path: '/history',
      name: 'history',
      component:History 
    },
    {
      path: '/panorama',
      name: 'panorama',
      component:Panorama 
    },
    {
      path: '/photo',
      name: 'photo',
      component:Photo 
    },
    {
      path: '/video',
      name: 'video',
      component:Video 
    },
    {
      path: '/vioce',
      name: 'vioce',
      component:Vioce 
    },
    {
      path: '/voicePlay',
      name: 'voicePlay',
      component:VoicePlay 
    },
    {
      path: '/photoInfo',
      name: 'photoInfo',
      component:PhotoInfo 
    },
    {
      path: '/videoPlay',
      name: 'videoPlay',
      component:VideoPlay 
    },
    {
      path: '/outline',
      name: 'outline',
      component: Outline
    },
    {
      path: '/traffic',
      name: 'traffic',
      component:TrafficInformation 
    },
    
  ]
})

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}